
import { AppViewBase, VueLifeCycleProcessing } from 'ibiz-vue';
import { Component } from 'vue-property-decorator';
import { AppIndexViewBase, AppLayoutService } from "ibiz-vue";



/**
 * 新建申请视图插件插件类
 *
 * @export
 * @class NewInitialView
 * @extends {Vue}
 */
@Component({})
@VueLifeCycleProcessing()
export class NewInitialView extends AppIndexViewBase {

    
    /**
     * 渲染视图主题内容
     * 
     */
    public renderMainContent() {
        let { targetCtrlName, targetCtrlParam, targetCtrlEvent }: { targetCtrlName: string, targetCtrlParam: any, targetCtrlEvent: any } = this.computeTargetCtrlData(this.menuInstance);
        return this.$createElement('app-user-new-menu', { props: targetCtrlParam, ref: this.menuInstance?.name, on: targetCtrlEvent });
    }

     /**
     * 应用首页视图渲染
     * 
     */
      render(h: any){
        if(!this.viewIsLoaded){
            return null;
        }
        const targetViewLayoutComponent: any = AppLayoutService.getLayoutComponent(`${this.viewInstance?.viewType}-DEFAULT`);        
        return h(targetViewLayoutComponent, {
            props: { viewInstance: this.viewInstance, model: this.model, modelService: this.modelService, viewparams: this.viewparams, context: this.context },
            on: {
                onCollapseChange: (collapseChange: any)=>{this.collapseChange = collapseChange},
            }
        }, [
            this.renderMainContent()
        ]);
    }   


}
